This invention relates to machine vision, and particularly to refining a geometric description and pose of an object in a digital image.
Many machine vision systems use geometric descriptions (GD) as canonical models for inspecting or recognizing objects within images. A GD is a collection of data that specifies the basic geometry of the object, that is the location of object features and dimensions of object features relative to each other, where the features include the object body, the number of extensions, or the number of lead sets, for instance.
Often, such GD-based models must accurately reflect the physical dimensions of the objects so that the position of the objects can be determined in an image, and so that precise tolerance checking and defect detection can be performed. For example, the contacts on printed circuit boards (PCB) must be within tolerances in order to correctly mate with corresponding contacts in a slot of a connector, such as the connector 160 and the PCB 162, shown in FIG. 1C, not drawn to scale.
For example, a vision-based automatic surface mounter (SMD) machine typically employs a GD-based model of leaded objects to accurately inspect and place leaded objects on a printed circuit board (PCB) by properly registering the object with pads on a PCB, such that the centers of the feet of the object align with the centers of pads on the PCB within positional tolerances. Registration of a pair of objects shall be defined as orienting a first object with respect to a second object so as to make all alignment parameters of the first object substantially equal to the corresponding alignment parameters of the second object. For example, a first semiconductor fabrication mask is said to be registered with an overlaying second semiconductor fabrication mask when a pair of fiducial marks of the first mask is located at the same projective position as the corresponding fiducial marks on the second mask.
FIG. 1A illustrates a bottom view and a side view of a gullwing-leaded object 100, not drawn to scale, where a leaded object is an electronic component that has a object body 110 and leads 102. The leads 102 are metal contacts on the exterior surface of the object body 110 that are connected to an integrated circuit (not shown) within the object body 110. Each of the leads 102 have feet 111 which comprise the portion of each of the leads 124 that makes contact with the PCB in a solder joint. Leaded objects include surface-mount components and through-hole components, for example.
The process of creating accurate GD-based models of objects, either by manually measuring the dimensions of the object, or by extracting the dimensions from manufacturing specifications, can be very tedious, especially when the objects are complicated.
Not only is the creation of the GD difficult, the task must be repeated for each object in a product; this makes changeover to new products on an assembly line very slow. For example, in addition to the SMD and through-hole leaded objects there are many types of BGA components, chips and all sorts of complicated odd-form objects, such as coils and connectors. Further, new objects are continually being introduced. Therefore, a prior GD cannot be reused without modification.
An alternative approach useful for some applications is to create featural models rather than models based on GD. A featural model describes the two-dimensional spatial arrangement of features, such as edges or corners, that constitute the appearance of an object. Featural models, however, require a large amount of processing memory, and an operator looking at the object cannot easily verify the correctness of featural models.
A method is disclosed for refining a rough GD of an object having a plurality of extensions. Inputs to the method are a rough GD and a rough pose of the object within a digital image. The method evaluates the digital image of the object and locates at least two xe2x80x9canchor pointsxe2x80x9d related to the extensions in the image. The xe2x80x9canchor pointsxe2x80x9d are used to align in at least one dimension the rough GD relative to the object in the image. The dimensions of the object are then measured. The rough GD and the rough pose are updated with the measured dimensions to create a refined GD and a refined pose of at least a portion of the object and the plurality of extensions.
In one embodiment, the xe2x80x9canchor pointsxe2x80x9d include points on substantially all the extensions extending from one side of the object. It is recognized by the invention that multiple xe2x80x9canchor pointsxe2x80x9d along at least one side of the object, i.e., more data points per parameter, allows more accurate alignment of the rough GD relative to the object in the image. Consequently, the method makes more accurate subsequent measurements.
The subsequent measurements use information derived from prior measurements, such as measuring length using the orientation of the aligned rough GD, (i.e., the measurements build upon each other). Preferably, the measurements having fewer unknowns are determined before more difficult measurements. For instance, the method measures lead length of a leaded object before determining foot length of a leaded object, which is a more difficult measurement, or the method measures one-dimensional parameters, such as length, before measuring two-dimensional parameters, such as area. The invention recognizes that to correctly measure parameters of an object it is most useful first to refine the angular direction of the object followed by refining other one-dimensional parameters, and finally by refining the more difficult parameters last.
In one embodiment, an area of a portion of an extension, e.g., a foot of a lead, is measured by binarizing the portion with a threshold determined from predetermined parameters, such as the expected area. The binarized image is evaluated to determine the area.
In one embodiment, the method is applied iteratively, such that the first refined GD and refined pose becomes the rough GD and rough pose, and the process is repeated.
Uses of averages and expected parameters are disclosed that make the method more robust and the resulting measurements and the refined GD and refined pose more reliable, such as validating the GD against predetermined conditions to obviate obviously incorrect parts of the GD.
One of the advantages of the invention is that only easily obtainable input, a rough GD and pose, is required from an operator, while the invention determines the difficult parameters. Another advantage is that the invention achieves the accuracy of a featural model, while using less memory than a featural model. A further advantage of the invention is that the refined GD is visually verifiable by an operator as opposed to a featural model. A still further advantage of the invention is that it can be used over a wide range of objects.
A preferred application of the methods and apparatuses is generating a refined GD and refined pose of leaded objects.